package com.zx.context;/**
 * Author:JasonZ
 * Data:2023/4/17
 */

import com.zx.model.vo.LoginUserInfo;

/**
 * @program: ecommerce-parent
 *
 * @description:
 *
 * @author: JasonZ
 *
 * @create: 2023-04-17 16:40
 **/

public class AccessContext {
    private static final ThreadLocal<LoginUserInfo>userContext=new ThreadLocal<>();

    public static void setUserContext(LoginUserInfo loginUserInfo){
        userContext.set(loginUserInfo);
    }

    public static LoginUserInfo getUserInfo(){
        return userContext.get();
    }

    public static void clear(){
        userContext.remove();
    }
}
